package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.LeaveMapper;
import com.ruoyi.system.domain.Leave;
import com.ruoyi.system.service.ILeaveService;
import com.ruoyi.common.core.text.Convert;

/**
 * 请假记录Service业务层处理
 * 
 * @author 503
 * @date 2021-05-04
 */
@Service
public class LeaveServiceImpl implements ILeaveService 
{
    @Autowired
    private LeaveMapper leaveMapper;

    /**
     * 查询请假记录
     * 
     * @param leaveId 请假记录ID
     * @return 请假记录
     */
    @Override
    public Leave selectLeaveById(Long leaveId)
    {
        return leaveMapper.selectLeaveById(leaveId);
    }

    /**
     * 查询请假记录列表
     * 
     * @param leave 请假记录
     * @return 请假记录
     */
    @Override
    public List<Leave> selectLeaveList(Leave leave)
    {
        return leaveMapper.selectLeaveList(leave);
    }

    /**
     * 新增请假记录
     * 
     * @param leave 请假记录
     * @return 结果
     */
    @Override
    public int insertLeave(Leave leave)
    {
        return leaveMapper.insertLeave(leave);
    }

    /**
     * 修改请假记录
     * 
     * @param leave 请假记录
     * @return 结果
     */
    @Override
    public int updateLeave(Leave leave)
    {
        return leaveMapper.updateLeave(leave);
    }

    /**
     * 删除请假记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLeaveByIds(String ids)
    {
        return leaveMapper.deleteLeaveByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除请假记录信息
     * 
     * @param leaveId 请假记录ID
     * @return 结果
     */
    @Override
    public int deleteLeaveById(Long leaveId)
    {
        return leaveMapper.deleteLeaveById(leaveId);
    }
}
